#include "Yeti.h"

const char * error_message(int result)
{
    switch (result) {
        case YETI_SUCCESS: return "YETI_SUCCESS";
        case YETI_FAILURE: return "YETI_FAILURE";

        case YETI_ERROR_INVALID_PARAMETERS: return "YETI_ERROR_INVALID_PARAMETERS";
        case YETI_ERROR_PERMISSION_DENIED: return "YETI_ERROR_PERMISSION_DENIED";
        case YETI_ERROR_OUT_OF_MEMORY: return "YETI_ERROR_OUT_OF_MEMORY";
        case YETI_ERROR_NO_SUCH_NAME: return "YETI_ERROR_NO_SUCH_NAME";
        case YETI_ERROR_NO_SUCH_PROPERTY: return "YETI_ERROR_NO_SUCH_PROPERTY";
        case YETI_ERROR_NO_SUCH_ITEM: return "YETI_ERROR_NO_SUCH_ITEM";
        case YETI_ERROR_NO_SUCH_CLASS: return "YETI_ERROR_NO_SUCH_CLASS";
        case YETI_ERROR_OVERFLOW: return "YETI_ERROR_OVERFLOW";
        case YETI_ERROR_INTERNAL: return "YETI_ERROR_INTERNAL";
        case YETI_ERROR_INVALID_STATE: return "YETI_ERROR_INVALID_STATE";
        case YETI_ERROR_INVALID_FORMAT: return "YETI_ERROR_INVALID_FORMAT";
        case YETI_ERROR_INVALID_SYNTAX: return "YETI_ERROR_INVALID_SYNTAX";
        case YETI_ERROR_NOT_IMPLEMENTED: return "YETI_ERROR_NOT_IMPLEMENTED";
        case YETI_ERROR_NOT_SUPPORTED: return "YETI_ERROR_NOT_SUPPORTED";
        case YETI_ERROR_TIMEOUT: return "YETI_ERROR_TIMEOUT";
        case YETI_ERROR_WOULD_BLOCK: return "YETI_ERROR_WOULD_BLOCK";
        case YETI_ERROR_TERMINATED: return "YETI_ERROR_TERMINATED";
        case YETI_ERROR_OUT_OF_RANGE: return "YETI_ERROR_OUT_OF_RANGE";
        case YETI_ERROR_OUT_OF_RESOURCES: return "YETI_ERROR_OUT_OF_RESOURCES";
        case YETI_ERROR_NOT_ENOUGH_SPACE: return "YETI_ERROR_NOT_ENOUGH_SPACE";
        case YETI_ERROR_INTERRUPTED: return "YETI_ERROR_INTERRUPTED";
        case YETI_ERROR_CANCELLED: return "YETI_ERROR_CANCELLED";
            // list
        case YETI_ERROR_LIST_EMPTY: return "YETI_ERROR_LIST_EMPTY";
        case YETI_ERROR_LIST_OPERATION_ABORTED: return "YETI_ERROR_LIST_OPERATION_ABORTED";
        case YETI_ERROR_LIST_OPERATION_CONTINUE: return "YETI_ERROR_LIST_OPERATION_CONTINUE";
            //    // file
            //case YETI_ERROR_NO_SUCH_FILE: return "YETI_ERROR_NO_SUCH_FILE";
            //case YETI_ERROR_FILE_NOT_OPEN: return "YETI_ERROR_FILE_NOT_OPEN";
            //case YETI_ERROR_FILE_BUSY: return "YETI_ERROR_FILE_BUSY";
            //case YETI_ERROR_FILE_ALREADY_OPEN: return "YETI_ERROR_FILE_ALREADY_OPEN";
            //case YETI_ERROR_FILE_NOT_READABLE: return "YETI_ERROR_FILE_NOT_READABLE";
            //case YETI_ERROR_FILE_NOT_WRITABLE: return "YETI_ERROR_FILE_NOT_WRITABLE";
            //case YETI_ERROR_FILE_NOT_DIRECTORY: return "YETI_ERROR_FILE_NOT_DIRECTORY";
            //case YETI_ERROR_FILE_ALREADY_EXISTS: return "YETI_ERROR_FILE_ALREADY_EXISTS";
            //case YETI_ERROR_FILE_NOT_ENOUGH_SPACE: return "YETI_ERROR_FILE_NOT_ENOUGH_SPACE";
            //case YETI_ERROR_DIRECTORY_NOT_EMPTY: return "YETI_ERROR_DIRECTORY_NOT_EMPTY";
            //case YETI_ERROR_READ_FAILED: return "YETI_ERROR_READ_FAILED";
            //case YETI_ERROR_WRITE_FAILED: return "YETI_ERROR_WRITE_FAILED";
            //case YETI_ERROR_EOS: return "YETI_ERROR_EOS";
            //case YETI_ERROR_CONNECTION_RESET: return "YETI_ERROR_CONNECTION_RESET";
            //case YETI_ERROR_CONNECTION_ABORTED: return "YETI_ERROR_CONNECTION_ABORTED";
            //case YETI_ERROR_CONNECTION_REFUSED: return "YETI_ERROR_CONNECTION_REFUSED";
            //case YETI_ERROR_CONNECTION_FAILED: return "YETI_ERROR_CONNECTION_FAILED";
            //case YETI_ERROR_HOST_UNKNOWN: return "YETI_ERROR_HOST_UNKNOWN";
            //case YETI_ERROR_SOCKET_FAILED: return "YETI_ERROR_SOCKET_FAILED";
            //case YETI_ERROR_GETSOCKOPT_FAILED: return "YETI_ERROR_GETSOCKOPT_FAILED";
            //case YETI_ERROR_SETSOCKOPT_FAILED: return "YETI_ERROR_SETSOCKOPT_FAILED";
            //case YETI_ERROR_SOCKET_CONTROL_FAILED: return "YETI_ERROR_SOCKET_CONTROL_FAILED";
            //case YETI_ERROR_BIND_FAILED: return "YETI_ERROR_BIND_FAILED";
            //case YETI_ERROR_LISTEN_FAILED: return "YETI_ERROR_LISTEN_FAILED";
            //case YETI_ERROR_ACCEPT_FAILED: return "YETI_ERROR_ACCEPT_FAILED";
            //case YETI_ERROR_ADDRESS_IN_USE: return "YETI_ERROR_ADDRESS_IN_USE";
            //case YETI_ERROR_NETWORK_DOWN: return "YETI_ERROR_NETWORK_DOWN";
            //case YETI_ERROR_NETWORK_UNREACHABLE: return "YETI_ERROR_NETWORK_UNREACHABLE";
            //case YETI_ERROR_NO_SUCH_INTERFACE: return "YETI_ERROR_NO_SUCH_INTERFACE";
            //case YETI_ERROR_XML_INVALID_NESTING: return "YETI_ERROR_XML_INVALID_NESTING";
            //case YETI_ERROR_XML_TAG_MISMATCH: return "YETI_ERROR_XML_TAG_MISMATCH";
            //case YETI_ERROR_HTTP_INVALID_RESPONSE_LINE: return "YETI_ERROR_HTTP_INVALID_RESPONSE_LINE";
            //case YETI_ERROR_HTTP_INVALID_REQUEST_LINE: return "YETI_ERROR_HTTP_INVALID_REQUEST_LINE";
            //case YETI_ERROR_HTTP_NO_PROXY: return "YETI_ERROR_HTTP_NO_PROXY";
            //case YETI_ERROR_HTTP_INVALID_REQUEST: return "YETI_ERROR_HTTP_INVALID_REQUEST";
            //case YETI_ERROR_HTTP_METHOD_NOT_SUPPORTED: return "YETI_ERROR_HTTP_METHOD_NOT_SUPPORTED";
            //case YETI_ERROR_HTTP_TOO_MANY_REDIRECTS: return "YETI_ERROR_HTTP_TOO_MANY_REDIRECTS";
            //case YETI_ERROR_HTTP_TOO_MANY_RECONNECTS: return "YETI_ERROR_HTTP_TOO_MANY_RECONNECTS";
            //case YETI_ERROR_HTTP_CANNOT_RESEND_BODY: return "YETI_ERROR_HTTP_CANNOT_RESEND_BODY";
            //case YETI_ERROR_CALLBACK_HANDLER_SHUTDOWN: return "YETI_ERROR_CALLBACK_HANDLER_SHUTDOWN";
            //case YETI_ERROR_CALLBACK_NOTHING_PENDING: return "YETI_ERROR_CALLBACK_NOTHING_PENDING";
            //case YETI_ERROR_NO_SUCH_SERIAL_PORT: return "YETI_ERROR_NO_SUCH_SERIAL_PORT";
            //case YETI_ERROR_SERIAL_PORT_NOT_OPEN: return "YETI_ERROR_SERIAL_PORT_NOT_OPEN";
            //case YETI_ERROR_SERIAL_PORT_ALREADY_OPEN: return "YETI_ERROR_SERIAL_PORT_ALREADY_OPEN";
            //case YETI_ERROR_SERIAL_PORT_BUSY: return "YETI_ERROR_SERIAL_PORT_BUSY";
            //case YETI_ERROR_INVALID_PASSWORD: return "YETI_ERROR_INVALID_PASSWORD";
            //case YETI_ERROR_TLS_INVALID_HANDSHAKE: return "YETI_ERROR_TLS_INVALID_HANDSHAKE";
            //case YETI_ERROR_TLS_INVALID_PROTOCOL_MESSAGE: return "YETI_ERROR_TLS_INVALID_PROTOCOL_MESSAGE";
            //case YETI_ERROR_TLS_INVALID_HMAC: return "YETI_ERROR_TLS_INVALID_HMAC";
            //case YETI_ERROR_TLS_INVALID_VERSION: return "YETI_ERROR_TLS_INVALID_VERSION";
            //case YETI_ERROR_TLS_INVALID_SESSION: return "YETI_ERROR_TLS_INVALID_SESSION";
            //case YETI_ERROR_TLS_NO_CIPHER: return "YETI_ERROR_TLS_NO_CIPHER";
            //case YETI_ERROR_TLS_BAD_CERTIFICATE: return "YETI_ERROR_TLS_BAD_CERTIFICATE";
            //case YETI_ERROR_TLS_INVALID_KEY: return "YETI_ERROR_TLS_INVALID_KEY";
            //case YETI_ERROR_TLS_NO_CLIENT_RENEGOTIATION: return "YETI_ERROR_TLS_NO_CLIENT_RENEGOTIATION";
            //case YETI_ERROR_TLS_INVALID_FINISHED_MESSAGE: return "YETI_ERROR_TLS_INVALID_FINISHED_MESSAGE";
            //case YETI_ERROR_TLS_NO_CERTIFICATE_DEFINED: return "YETI_ERROR_TLS_NO_CERTIFICATE_DEFINED";
            //case YETI_ERROR_TLS_ALERT_HANDSHAKE_FAILED: return "YETI_ERROR_TLS_ALERT_HANDSHAKE_FAILED";
            //case YETI_ERROR_TLS_ALERT_BAD_CERTIFICATE: return "YETI_ERROR_TLS_ALERT_BAD_CERTIFICATE";
            //case YETI_ERROR_TLS_ALERT_INVALID_VERSION: return "YETI_ERROR_TLS_ALERT_INVALID_VERSION";
            //case YETI_ERROR_TLS_ALERT_BAD_RECORD_MAC: return "YETI_ERROR_TLS_ALERT_BAD_RECORD_MAC";
            //case YETI_ERROR_TLS_ALERT_DECODE_ERROR: return "YETI_ERROR_TLS_ALERT_DECODE_ERROR";
            //case YETI_ERROR_TLS_ALERT_DECRYPT_ERROR: return "YETI_ERROR_TLS_ALERT_DECRYPT_ERROR";
            //case YETI_ERROR_TLS_ALERT_ILLEGAL_PARAMETER: return "YETI_ERROR_TLS_ALERT_ILLEGAL_PARAMETER";
            //case YETI_ERROR_TLS_ALERT_UNEXPECTED_MESSAGE: return "YETI_ERROR_TLS_ALERT_UNEXPECTED_MESSAGE";
            //case YETI_ERROR_TLS_CERTIFICATE_FAILURE: return "YETI_ERROR_TLS_CERTIFICATE_FAILURE";
            //case YETI_ERROR_TLS_CERTIFICATE_NO_TRUST_ANCHOR: return "YETI_ERROR_TLS_CERTIFICATE_NO_TRUST_ANCHOR";
            //case YETI_ERROR_TLS_CERTIFICATE_BAD_SIGNATURE: return "YETI_ERROR_TLS_CERTIFICATE_BAD_SIGNATURE";
            //case YETI_ERROR_TLS_CERTIFICATE_NOT_YET_VALID: return "YETI_ERROR_TLS_CERTIFICATE_NOT_YET_VALID";
            //case YETI_ERROR_TLS_CERTIFICATE_EXPIRED: return "YETI_ERROR_TLS_CERTIFICATE_EXPIRED";
            //case YETI_ERROR_TLS_CERTIFICATE_SELF_SIGNED: return "YETI_ERROR_TLS_CERTIFICATE_SELF_SIGNED";
            //case YETI_ERROR_TLS_CERTIFICATE_INVALID_CHAIN: return "YETI_ERROR_TLS_CERTIFICATE_INVALID_CHAIN";
            //case YETI_ERROR_TLS_CERTIFICATE_UNSUPPORTED_DIGEST: return "YETI_ERROR_TLS_CERTIFICATE_UNSUPPORTED_DIGEST";
            //case YETI_ERROR_TLS_CERTIFICATE_INVALID_PRIVATE_KEY: return "YETI_ERROR_TLS_CERTIFICATE_INVALID_PRIVATE_KEY";
            //case YETI_ERROR_TLS_DNS_NAME_MISMATCH: return "YETI_ERROR_TLS_DNS_NAME_MISMATCH";

        default: return "UNKNOWN";
    }
}
